
class UserGQL {
  static const String fetchLoginUser = r'''
mutation MyMutation($password: String, $username: String) {
  user {
    loginUser(input: {username: $username, password: $password}) {
      accessToken
      avatarAddr
      createTime
      id
      nickname
      refreshToken
      status
      updateTime
      username
    }
  }
}
  ''';


  static const String fetchRegisterUser = r'''
mutation MyMutation(
  $avatarAddr: String 
  $email: String 
  $nickname: String 
  $password: String 
  $username: String 
) {
  user {
    registerUser(
      input: {
        username: $username
        password: $password
        avatarAddr: $avatarAddr
        email: $email
        nickname: $nickname
      }
    ) {
      accessToken
      avatarAddr
      createTime
      id
      nickname
      refreshToken
      status
      updateTime
      username
    }
  }
}
  ''';

  static const String fetchUserCartItems = r'''
query MyQuery {
  user {
    currentUser {
      cartItems {
        createTime
        id
        productId
        quantity
        updateTime
        userId
      }
    }
  }
}
  ''';

  static const String fetchRefreshToken = r'''
mutation MyMutation($refreshToken: String) {
  user {
    refreshToken(refreshToken: $refreshToken) {
      accessToken
      refreshToken
    }
  }
}
  ''';

  static const String fetchAddToCart = r'''
mutation MyMutation($productId: String, $quantity: Int) {
  user {
    addCurrentUserCartItem(productId: $productId, quantity: $quantity) {
      createTime
      id
      productId
      quantity
      updateTime
      userId
    }
  }
}
  ''';

  static const String fetchRemoveFromCart = r'''
mutation MyMutation($cartItemId: String) {
  user {
    deleteCurrentUserCartItem(cartItemId: $cartItemId)
  }
}
  ''';

  static const String fetchUpdateCartItem = r'''
 mutation MyMutation($cartItemId: String, $quantity: Int) {
  user {
    updateCurrentUserCartItem(quantity: $quantity, cartItemId: $cartItemId) {
      createTime
      id
      productId
      quantity
      updateTime
      userId
    }
  }
}
  ''';
  static const String fetchUserAddresses = r'''
query MyQuery {
  user {
    currentUser {
      addresses {
        city
        createTime
        detail
        district
        id
        isDefault
        phone
        province
        recipientName
        updateTime
        userId
        tag
      }
    }
  }
}
  ''';

  static const String fetchAddUserAddress = r'''
mutation MyMutation(
  $city: String = ""
  $detail: String = ""
  $district: String = ""
  $isDefault: Boolean = false
  $phone: String = ""
  $province: String = ""
  $recipientName: String = ""
  $tag: String = ""
) {
  user {
    addCurrentUserAddress(
      input: {
        recipientName: $recipientName
        phone: $phone
        province: $province
        city: $city
        district: $district
        detail: $detail
        tag: $tag
        isDefault: $isDefault
      }
    ) {
      city
      createTime
      detail
      district
      id
      isDefault
      phone
      province
      recipientName
      updateTime
      userId
    }
  }
}
        ''';

  static const  fetchDeleteUserAddress = r'''
mutation MyMutation(
  $addressId: String
) {
  user {
    deleteCurrentUserAddress(addressId: $addressId)
  }
}
  ''';

  static const String fetchUpdateUserAddress = r'''
mutation MyMutation(
  $addressId: String
  $city: String
  $detail: String
  $district: String 
  $isDefault: Boolean
  $phone: String 
  $province: String
  $recipientName: String
  $tag: String
) {
  user {
    updateCurrentUserAddress(
      addressId: $addressId
      input: {
        recipientName: $recipientName
        phone: $phone
        province: $province
        city: $city
        district: $district
        detail: $detail
        tag: $tag
        isDefault: $isDefault
      }
    ) {
      city
      createTime
      detail
      district
      id
      isDefault
      phone
      province
      recipientName
      updateTime
      userId
    }
  }
}
  ''';

  static const String fetchUserOpenWallet = r'''
mutation MyMutation($payPassword: String) {
  user {
    openCurrentUserWallet(payPassword: $payPassword) {
      balance
      createTime
      id
      updateTime
      userId
    }
  }
}
  ''';

  static const String fetchUserWalletRecharge = r'''
mutation MyMutation(
  $payPassword1: String
  $channelType: String
  $channelId: String
  $amount: String
) {
  user {
    rechargeCurrentUserWallet(
      input: {
        amount: $amount
        channelId: $channelId
        channelType: $channelType
        payPassword: $payPassword1
      }
    ) {
      balance
      createTime
      id
      updateTime
      userId
    }
  }
}
  ''';

  static const String fetchUserWallet = r'''
query MyQuery {
  user {
    currentUser {
      wallet {
        balance
        createTime
        id
        updateTime
        userId
      }
    }
  }
}
  ''';

}